/**
 * @Author: 田乐
 * @Date: 2019/08/27
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019/08/27
 */
const RouteView = () => import('@/layout/RouteView');
// 异步路由组件加载
const AsyncComponent = __name__ => () => import(`@/pages/${__name__}`);

// 菜单路由
const menuRoutes = [{
  path: '/customerManage',
  meta: {
    title: '大客户管理',
    icon: 'el-icon-s-tools'
  },
  redirect: '/customerManage',
  component: RouteView,
  children: [{
      path: '/customerManage/clue',
      meta: {
        title: '大客户线索管理'
      },
      redirect: '/customerManage/clue',
      component: RouteView,
      children: [{
          path: '/customerManage/clue/createClue/index',
          meta: {
            title: '线索建档',
            keepAlive: true
          },
          component: AsyncComponent('customerManage/clue/createClue/index')
        },
        {
          path: '/customerManage/clue/pushClue/index',
          meta: {
            title: '线索分配',
            keepAlive: true
          },
          component: AsyncComponent('customerManage/clue/pushClue/index')
        },
        {
          path: '/customerManage/clue/areaBossPush/index',
          meta: {
            title: '区域经理分配',
            keepAlive: true
          },
          component: AsyncComponent('customerManage/clue/areaBossPush/index')
        },
        {
          path: '/customerManage/clue/customerInfo/index',
          meta: {
            title: '大客户信息查询',
            keepAlive: true
          },
          component: AsyncComponent('customerManage/clue/customerInfo/index')
        },
        {
          path: '/customerManage/clue/areaBossOperation/index',
          meta: {
            title: '经销商大客户区域经理维护',
            keepAlive: true
          },
          component: AsyncComponent('customerManage/clue/areaBossOperation/index')
        }
      ]
    },
    {
      path: '/customerManage/approvalManage',
      meta: {
        title: '大客户项目报备管理'
      },
      redirect: '/customerManage/approvalManage',
      component: RouteView,
      children: [{
        path: '/customerManage/approvalManage/review/index',
        meta: {
          title: '大客户审核',
          keepAlive: true
        },
        component: AsyncComponent('customerManage/approvalManage/review/index')
      }]
    }
  ]
}];

export default menuRoutes;
